<?php
	require "settings/config.php";
	require "layout.php";
	require "includes/session.php";

	if(!oh_is_logged_in())
		header('Location: login.php');

	
	render_header("Settings");

	echo "<b>Change password:</b> ";
	
	if($_GET['badpass']==1)
	{
		echo "Current password is incorrect.";
	}
	else if($_GET['mismatch']==1)
	{
		echo "Passwords do not match!";
	}
	else if($_GET['passchanged']==1)
	{
		echo "Password successfully changed.";
	}
?>
	<br /><br />
	
	<form action="do_changepass.php" method="POST">
		Current Password: <input type="password" name="oldpass" size="32" class="inputbox"> <br /> <br />
		New Password: <input type="password" name="newpass" size="32" class="inputbox"> <br /> <br />
		New Password (confirm): <input type="password" name="newpass2" size="32" class="inputbox"> <br /> <br />
		<input type="submit" class="button" value="Change Password">
	</form>
	
	<br />
<?php
	echo "<b>Change email settings:</b><br />\n ";
	echo "<br />\n";
	echo "Do you wish to recieve email notifications from GMs and administrators?<br />\n";
	echo "This is recommended so that you can recieve updates if a game is rescheduled or canceled.<br />\n";
	echo "<br />\n";
	make_button("Yes","do_firstlogin.php?optin=1");
	echo " ";
	make_button("No","do_firstlogin.php?optin=0");

?>
<?php
	render_footer();
?>